//package jedis;
//import redis.clients.jedis.Jedis;
//
//import java.util.Iterator;
//import java.util.List;
//import java.util.Set;
//
//public class RedisTest {
//    public static void main(String[] args) {
//
//        //连接本地的 Redis 服务
//        String host = "127.0.0.1";
//        int port = 6379;
//        int timeout = 1000;//超时时间,1秒超时
//        Jedis jedis = new Jedis(host, port, timeout);
//        // 如果 Redis 服务设置了密码，需要下面这行，没有就不需要
//        // jedis.auth("123456");
//        System.out.println("连接成功");
//        //查看服务是否运行
//        System.out.println("服务正在运行: " + jedis.ping());
//
//
//
////String类型数据的增删改查操作
////        System.out.println(jedis.set("name","zhangsan"));//新增
////        System.out.println(jedis.get("name"));//获取
////        System.out.println(jedis.set("name","zhangsan1"));//修改
////        System.out.println(jedis.get("name"));//获取
////        System.out.println(jedis.del("name"));//删除
//
//
////List的操作
////        jedis.lpush("students1","1","2","3","5","6");
////        // 获取存储的数据并输出
////        List<String> list = jedis.lrange("students1", 0 ,3);
////        for(int i=0; i<list.size(); i++) {
////            System.out.println("列表项为: "+list.get(i));
////        }
//
//
////Set的操作
////        jedis.sadd("students2","a1","b1","c1","b1");
////        System.out.println(jedis.smembers("students2"));
//
////ZSet的操作
////        jedis.zadd("students3",166.3,"a1");
////        System.out.println(jedis.zrange("students3",0,-1));
//
//
////Hash的操作
////        jedis.hset("students4","student","zhangsan");
////        System.out.println(jedis.hget("students4", "student"));
//
////key的操作
////        Set<String> keys = jedis.keys("*");
////        Iterator<String> it=keys.iterator() ;
////        while(it.hasNext()){
////            String key = it.next();
////            System.out.println(key);
////        }
//
//
//    }
//}
